package com.sinooceangroup.capital.productor.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Random;
import java.util.UUID;

/**
 * Controller demo
 * @author: Leo.Wang, adwyxx@qq.com
 * @date: 2020/7/17 14:18
 */
@RestController
public class ProductorController {

    @GetMapping("/api/hello-world")
    public String helloWorld(){
        return "Hello world!";
    }

    @GetMapping("/api/sentinel-feign")
    public String sentinelFeign(){
        Random r = new Random();
        String uuid = UUID.randomUUID().toString();
        int i =  r.ints(-10,3).findFirst().getAsInt();
        if(i<0){
            throw new RuntimeException("=================>>>>> "+i+"=================>>>>>uuid :"+uuid);
        }
        return "productor serivce sentinel feign client test!!!" + uuid;
    }
}
